import { Model, Table, DataType, Index } from 'sequelize-typescript';
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';

@Entity({ name: 'goods_material' })
export class GoodsMaterial {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'name' })
  name: string;

  @Column({ name: 'img_url' })
  imgUrl: string;

  @Column({ name: 'img_main_urls', comment: '详情主图' })
  imgMainUrls!: string;

  @Column({ name: 'img_detail_urls', comment: '详情图片' })
  imgDetailUrls!: string;

  @Column({ name: 'resource', comment: '商品素材来源' })
  resource!: string;

  @Column({ name: 'resource_url', comment: '来源路径' })
  resourceUrl!: string;

  @Column({ name: 'resource_type', comment: '来源方式' })
  resourceType!: string;

  @Column({ name: 'operator_id', comment: '操作人员' })
  operatorId!: string;

  @Column({ name: 'operator_name', comment: '操作人名' })
  operatorName!: string;

  @Column({ name: 'dow_num', comment: '下载次数', default: 0 })
  dowNum!: number;

  @Column({ name: 'width', comment: '宽度' })
  width!: number;

  @Column({ name: 'height', comment: '高度' })
  height!: number;

  @Column({ name: 'category', comment: '类目' })
  category!: number;

  @Column({ name: 'bar_code', comment: '条形码' })
  barCode!: string;

  @Column({ name: 'create_time' })
  createTime!: Date;

  @Column({ name: 'update_time' })
  updateTime!: Date;
}
